var index=0;
var baseInfo={
    avatar:"../img/avatar/avatar_me.jpg",
    nickName:"胡子哥",
    phoneType:"OPPO R11",
    fkToday:"24",
    fkAll:"9999+",
};
var message=[
    {
        avatar:"./img/avatar/avatar_xxbb.jpg",
        nickName:"旭旭宝宝",
        content:"快点上号，带你刷深渊。苍穹幕落太刀必出！",
        time:"刚刚"
    },{avatar:"./img/avatar/avatar_doinb.png", nickName:"金咕咕", content:"gdx，你在干嘛？", time:"17:31"},
    {avatar:"./img/avatar/avatar_james.png", nickName:"詹姆斯", content:"来湖人，带你拿冠军", time:"11:51"},
    {avatar:"./img/avatar/avatar_harden.png", nickName:"哈登", content:"帮我找个能投三分的中锋", time:"08:12"},
    {avatar:"./img/avatar/avatar_Cluo.png", nickName:"C罗", content:"帽子戏法", time:"昨天"},
    {avatar:"./img/avatar/avatar_Yyx.png", nickName:"尤玉溪", content:"我发布了Vue3.0", time:"9-24"},
]
var myFriend=[
    {
        avatar:"./img/avatar/avatar_xxbb.jpg",
        nickName:"旭旭宝宝",
        content:"快点上号，带你刷深渊。",
        state:"在线"
    },{avatar:"./img/avatar/avatar_doinb.png", nickName:"金咕咕", content:"想再拿个S赛冠军", state:"在线"},
    {avatar:"./img/avatar/avatar_james.png", nickName:"詹姆斯", content:"I'm 4MVP，4FMVP", state:"iphone6在线"},
    {avatar:"./img/avatar/avatar_harden.png", nickName:"哈登", content:"下赛季努力，争取到西决吧，呜呜呜", state:"iphone12在线"},
    {avatar:"./img/avatar/avatar_Cluo.png", nickName:"C罗", content:"疫情影响，足球没法踢了都", state:"手机在线"},
    {avatar:"./img/avatar/avatar_Yyx.png", nickName:"尤玉溪", content:"我发布了Vue3.0，vite非常快", state:"电脑在线"},
]

$(function (){
    //tabbar↓
    $("#tabbarItem1").click(function (){
        $("#tabbarItem1 .tabbarText").addClass("tabbarSelected")
        $("#tabbarItem2 .tabbarText").removeClass("tabbarSelected")
        $("#tabbarItem3 .tabbarText").removeClass("tabbarSelected");
        $("#tabbarItem1 img").attr("src","./img/tabbar/tabbar1Selected.png")
        $("#tabbarItem2 img").attr("src","./img/tabbar/tabbar2.png")
        $("#tabbarItem3 img").attr("src","./img/tabbar/tabbar3.png");
        $(".tabbar1").show()
        $(".tabbar2").hide()
        $(".tabbar3").hide();
        $(".top").show()
        $(".search").show();
    })
    $("#tabbarItem2").click(function (){
        $("#tabbarItem1 .tabbarText").removeClass("tabbarSelected")
        $("#tabbarItem2 .tabbarText").addClass("tabbarSelected")
        $("#tabbarItem3 .tabbarText").removeClass("tabbarSelected");
        $("#tabbarItem1 img").attr("src","./img/tabbar/tabbar1.png")
        $("#tabbarItem2 img").attr("src","./img/tabbar/tabbar2Selected.png")
        $("#tabbarItem3 img").attr("src","./img/tabbar/tabbar3.png");
        $(".tabbar1").hide()
        $(".tabbar2").show()
        $(".tabbar3").hide();
        $(".top").show()
        $(".search").show();
    })
    $("#tabbarItem3").click(function (){
        $("#tabbarItem1 .tabbarText").removeClass("tabbarSelected")
        $("#tabbarItem2 .tabbarText").removeClass("tabbarSelected")
        $("#tabbarItem3 .tabbarText").addClass("tabbarSelected");
        $("#tabbarItem1 img").attr("src","./img/tabbar/tabbar1.png")
        $("#tabbarItem2 img").attr("src","./img/tabbar/tabbar2.png")
        $("#tabbarItem3 img").attr("src","./img/tabbar/tabbar3Selected.png");
        $(".tabbar1").hide()
        $(".tabbar2").hide()
        $(".tabbar3").show();
        $(".top").hide()
        $(".search").hide();
    });
    //tabbar↑

    //tabbar1↓
    $.each(message,function (index,value){
        var html="<div class=\"messageItem flex flex-between borderBottom\">\n" +
            "            <div class=\"flex\">\n" +
            "                <img class=\"borderRadius50\" src=\""+value.avatar+"\" alt=\"\">\n" +
            "                <div class=\"content\">\n" +
            "                    <p class=\"nickName\">"+value.nickName+"</p>\n" +
            "                    <p class=\"text noWrapHiddenEllipse\">"+value.content+"</p>\n" +
            "                </div>\n" +
            "            </div>\n" +
            "            <p class=\"time marginAuto0\">"+value.time+"</p>\n" +
            "        </div>";
        $(".tabbar1").append(html);
    })
    //tabbar1↑

    //tabbar2↓
    $("#typeText1").click(function (){
        $("#typeText1").addClass("typeSelected")
        $("#typeText2").removeClass("typeSelected")
        $("#typeText3").removeClass("typeSelected")
        $("#typeText4").removeClass("typeSelected");
    })
    $("#typeText2").click(function (){
        $("#typeText1").removeClass("typeSelected")
        $("#typeText2").addClass("typeSelected")
        $("#typeText3").removeClass("typeSelected")
        $("#typeText4").removeClass("typeSelected");
    })
    $("#typeText3").click(function (){
        $("#typeText1").removeClass("typeSelected")
        $("#typeText2").removeClass("typeSelected")
        $("#typeText3").addClass("typeSelected")
        $("#typeText4").removeClass("typeSelected");
    })
    $("#typeText4").click(function (){
        $("#typeText1").removeClass("typeSelected")
        $("#typeText2").removeClass("typeSelected")
        $("#typeText3").removeClass("typeSelected")
        $("#typeText4").addClass("typeSelected");
    });
    $.each(myFriend,function (index,value){
        var html="<div class=\"myFriendItem flex flex-between borderBottom\" style=\"display: none\">\n" +
            "            <div class=\"flex\">\n" +
            "                <img class=\"borderRadius50\" src=\""+value.avatar+"\" alt=\"\">\n" +
            "                <div class=\"myFriendItemContent\">\n" +
            "                    <p class=\"nickName\">"+value.nickName+"</p>\n" +
            "                    <p class=\"text  noWrapHiddenEllipse\">"+value.content+"</p>\n" +
            "                </div>\n" +
            "            </div>\n" +
            "            <p class=\"state noWrapHiddenEllipse marginAuto0\">"+value.state+"</p>\n" +
            "        </div>";
        $(".allPart").append(html);
    })
    $("#myInterFriend").click(function (){
        var img=$("#myInterFriend").find(".mainFriendItemLeft img");
        $(".myFriendItem").slideToggle(100);
        if(img.attr("src")==="./img/rightSjx.png") img.attr("src","./img/bottomSjx.png");
        else img.attr("src","./img/rightSjx.png");
        // console.log(img.attr("src"))
    })
    $(".stateNum").text(myFriend.length+"/"+myFriend.length)
    //tabbar2↑

    //tabbar3↓
    $(".addSs").click(function (){
        $(".tabbar3").hide();
        $(".tabbar").hide();
    })
    //tabbar3↑
})